<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class FangRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            "fang_name" => "required",
            "fang_xiaoqu" => "required",
            "fang_province" => "required|numeric|min:1",
            "fang_city" => "required",
            "fang_region" => "required",
            "fang_addr" => "required",
            "fang_direction" => "required",
            "fang_build_area" => "required",
            "fang_using_area" => "required",
            "fang_year" => "required",
            "fang_rent" => "required",
            "fang_floor" => "required",
            "fang_shi" => "required",
            "fang_ting" => "required",
            "fang_wei" => "required",
            "fang_pic" => "required",
            "fang_rent_class" => "required",
            "fang_config" => "required",
            "fang_rent_type" => "required",
            "fang_owner" => "required",
            "fang_desn" => "required",
            "fang_body" => "required",
            "fang_group" => "required",
            "is_recommend" => "required",
        ];
    }
    public function messages()
    {
        return [
            "fang_name.required" => "房源名称不能为空",
            "fang_xiaoqu.required" => "房源小区名称不能为空",
            "fang_province.required" => "省份不能为空",
            "fang_province.min" => "必须选择省份",
            "fang_city.required" => "市份不能为空",
            "fang_region.required" => "区域不能为空",
            "fang_addr.required" => "房源地址不能为空",
            "fang_direction.required" => "房源朝向不能为空",
            "fang_build_area.required" => "房源面积不能为空",
            "fang_using_area.required" => "使用面积不能为空",
            "fang_year.required" => "建筑年代不能为空",
            "fang_rent.required" => "租金不能为空",
            "fang_floor.required" => "楼层不能为空",
            "fang_shi.required" => "几室不能为空",
            "fang_ting.required" => "几厅不能为空",
            "fang_wei.required" => "几卫不能为空",
            "fang_pic.required" => "房屋图片不能为空",
            "fang_rent_class.required" => "租赁方式不能为空",
            "fang_config.required" => "配套设施不能为空",
            "fang_rent_type.required" => "租期方式不能为空",
            "fang_owner.required" => "业主不能为空",
            "fang_desn.required" => "房源描述不能为空",
            "fang_body.required" => "房源信息不能为空",
            "fang_group.required" => "租房小组不能为空",
        ];
    }
}
